home *** CD-ROM | disk | FTP | other *** search
/ Windows Expert / Windows Expert.iso / windownt / cshx86.zip / SAMPLES / WEEKDAY.CSH < prev   
Text File  |  1993-04-14  |  423b  |  13 lines

  1. #    Calculate the day of the week corresponding to a given date.
  2. #    Copyright (c) 1991 by Hamilton Laboratories.  All rights reserved.
  3.  
  4. proc weekday(month, day, year)
  5.     local days, i
  6.     set days = Sunday Monday Tuesday Wednesday Thursday Friday Saturday
  7.     # Get the Julian day, but notice that 4713 BC was not a leap year.
  8.     if ((i = `julian $month $day $year`) < 58) @ i++
  9.     return days[(i + 2) % 7]
  10. end
  11.  
  12. weekday $argv
  13.